#pragma once
// MESSAGE XAP_SBG_EKF_NAV_MSG PACKING

#define MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG 20808


typedef struct __mavlink_xap_sbg_ekf_nav_msg_t {
 double latitude; /*<   Latitude, deg */
 double longitude; /*<   Longitude, deg */
 double altitude; /*<   Altitude above Mean Sea Level, m */
 uint32_t time_boot_ms; /*< [ms] Timestamp (milliseconds since system boot)*/
 float velpcity_n; /*<   Velocity in North direction, m/s */
 float velpcity_e; /*<   Velocity in East direction, m/s */
 float velpcity_d; /*<   Velocity in Down direction, m/s */
 float velpcity_n_acc; /*<   1b Velocity in North direction accuracy, m/s */
 float velpcity_e_acc; /*<   1b Velocity in East direction accuracy, m/s */
 float velpcity_d_acc; /*<   1b Velocity in Down direction accuracy, m/s */
 float undulation; /*<   Altitude difference between the geoid and the Ellipsoid. (WGS-84 Altitude = MSL Altitude + undulation), m */
 float latitude_acc; /*<   1b Latitude accuracy, deg */
 float longitude_acc; /*<   1b Longitude accuracy, deg */
 float altitude_acc; /*<   1b Vertical Position accuracy, m */
 uint32_t solution_status; /*<   Global solution status */
 int8_t sbg_id; /*<   Sbg device id */
} mavlink_xap_sbg_ekf_nav_msg_t;

#define MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN 73
#define MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_MIN_LEN 73
#define MAVLINK_MSG_ID_20808_LEN 73
#define MAVLINK_MSG_ID_20808_MIN_LEN 73

#define MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_CRC 15
#define MAVLINK_MSG_ID_20808_CRC 15



#if MAVLINK_COMMAND_24BIT
#define MAVLINK_MESSAGE_INFO_XAP_SBG_EKF_NAV_MSG { \
    20808, \
    "XAP_SBG_EKF_NAV_MSG", \
    16, \
    {  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, time_boot_ms) }, \
         { "sbg_id", NULL, MAVLINK_TYPE_INT8_T, 0, 72, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, sbg_id) }, \
         { "velpcity_n", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, velpcity_n) }, \
         { "velpcity_e", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, velpcity_e) }, \
         { "velpcity_d", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, velpcity_d) }, \
         { "velpcity_n_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, velpcity_n_acc) }, \
         { "velpcity_e_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, velpcity_e_acc) }, \
         { "velpcity_d_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, velpcity_d_acc) }, \
         { "latitude", NULL, MAVLINK_TYPE_DOUBLE, 0, 0, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, latitude) }, \
         { "longitude", NULL, MAVLINK_TYPE_DOUBLE, 0, 8, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, longitude) }, \
         { "altitude", NULL, MAVLINK_TYPE_DOUBLE, 0, 16, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, altitude) }, \
         { "undulation", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, undulation) }, \
         { "latitude_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, latitude_acc) }, \
         { "longitude_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, longitude_acc) }, \
         { "altitude_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, altitude_acc) }, \
         { "solution_status", NULL, MAVLINK_TYPE_UINT32_T, 0, 68, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, solution_status) }, \
         } \
}
#else
#define MAVLINK_MESSAGE_INFO_XAP_SBG_EKF_NAV_MSG { \
    "XAP_SBG_EKF_NAV_MSG", \
    16, \
    {  { "time_boot_ms", NULL, MAVLINK_TYPE_UINT32_T, 0, 24, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, time_boot_ms) }, \
         { "sbg_id", NULL, MAVLINK_TYPE_INT8_T, 0, 72, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, sbg_id) }, \
         { "velpcity_n", NULL, MAVLINK_TYPE_FLOAT, 0, 28, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, velpcity_n) }, \
         { "velpcity_e", NULL, MAVLINK_TYPE_FLOAT, 0, 32, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, velpcity_e) }, \
         { "velpcity_d", NULL, MAVLINK_TYPE_FLOAT, 0, 36, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, velpcity_d) }, \
         { "velpcity_n_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 40, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, velpcity_n_acc) }, \
         { "velpcity_e_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 44, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, velpcity_e_acc) }, \
         { "velpcity_d_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 48, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, velpcity_d_acc) }, \
         { "latitude", NULL, MAVLINK_TYPE_DOUBLE, 0, 0, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, latitude) }, \
         { "longitude", NULL, MAVLINK_TYPE_DOUBLE, 0, 8, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, longitude) }, \
         { "altitude", NULL, MAVLINK_TYPE_DOUBLE, 0, 16, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, altitude) }, \
         { "undulation", NULL, MAVLINK_TYPE_FLOAT, 0, 52, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, undulation) }, \
         { "latitude_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 56, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, latitude_acc) }, \
         { "longitude_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 60, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, longitude_acc) }, \
         { "altitude_acc", NULL, MAVLINK_TYPE_FLOAT, 0, 64, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, altitude_acc) }, \
         { "solution_status", NULL, MAVLINK_TYPE_UINT32_T, 0, 68, offsetof(mavlink_xap_sbg_ekf_nav_msg_t, solution_status) }, \
         } \
}
#endif

/**
 * @brief Pack a xap_sbg_ekf_nav_msg message
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 *
 * @param time_boot_ms [ms] Timestamp (milliseconds since system boot)
 * @param sbg_id   Sbg device id 
 * @param velpcity_n   Velocity in North direction, m/s 
 * @param velpcity_e   Velocity in East direction, m/s 
 * @param velpcity_d   Velocity in Down direction, m/s 
 * @param velpcity_n_acc   1b Velocity in North direction accuracy, m/s 
 * @param velpcity_e_acc   1b Velocity in East direction accuracy, m/s 
 * @param velpcity_d_acc   1b Velocity in Down direction accuracy, m/s 
 * @param latitude   Latitude, deg 
 * @param longitude   Longitude, deg 
 * @param altitude   Altitude above Mean Sea Level, m 
 * @param undulation   Altitude difference between the geoid and the Ellipsoid. (WGS-84 Altitude = MSL Altitude + undulation), m 
 * @param latitude_acc   1b Latitude accuracy, deg 
 * @param longitude_acc   1b Longitude accuracy, deg 
 * @param altitude_acc   1b Vertical Position accuracy, m 
 * @param solution_status   Global solution status 
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_xap_sbg_ekf_nav_msg_pack(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg,
                               uint32_t time_boot_ms, int8_t sbg_id, float velpcity_n, float velpcity_e, float velpcity_d, float velpcity_n_acc, float velpcity_e_acc, float velpcity_d_acc, double latitude, double longitude, double altitude, float undulation, float latitude_acc, float longitude_acc, float altitude_acc, uint32_t solution_status)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN];
    _mav_put_double(buf, 0, latitude);
    _mav_put_double(buf, 8, longitude);
    _mav_put_double(buf, 16, altitude);
    _mav_put_uint32_t(buf, 24, time_boot_ms);
    _mav_put_float(buf, 28, velpcity_n);
    _mav_put_float(buf, 32, velpcity_e);
    _mav_put_float(buf, 36, velpcity_d);
    _mav_put_float(buf, 40, velpcity_n_acc);
    _mav_put_float(buf, 44, velpcity_e_acc);
    _mav_put_float(buf, 48, velpcity_d_acc);
    _mav_put_float(buf, 52, undulation);
    _mav_put_float(buf, 56, latitude_acc);
    _mav_put_float(buf, 60, longitude_acc);
    _mav_put_float(buf, 64, altitude_acc);
    _mav_put_uint32_t(buf, 68, solution_status);
    _mav_put_int8_t(buf, 72, sbg_id);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN);
#else
    mavlink_xap_sbg_ekf_nav_msg_t packet;
    packet.latitude = latitude;
    packet.longitude = longitude;
    packet.altitude = altitude;
    packet.time_boot_ms = time_boot_ms;
    packet.velpcity_n = velpcity_n;
    packet.velpcity_e = velpcity_e;
    packet.velpcity_d = velpcity_d;
    packet.velpcity_n_acc = velpcity_n_acc;
    packet.velpcity_e_acc = velpcity_e_acc;
    packet.velpcity_d_acc = velpcity_d_acc;
    packet.undulation = undulation;
    packet.latitude_acc = latitude_acc;
    packet.longitude_acc = longitude_acc;
    packet.altitude_acc = altitude_acc;
    packet.solution_status = solution_status;
    packet.sbg_id = sbg_id;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG;
    return mavlink_finalize_message(msg, system_id, component_id, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_MIN_LEN, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_CRC);
}

/**
 * @brief Pack a xap_sbg_ekf_nav_msg message on a channel
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param time_boot_ms [ms] Timestamp (milliseconds since system boot)
 * @param sbg_id   Sbg device id 
 * @param velpcity_n   Velocity in North direction, m/s 
 * @param velpcity_e   Velocity in East direction, m/s 
 * @param velpcity_d   Velocity in Down direction, m/s 
 * @param velpcity_n_acc   1b Velocity in North direction accuracy, m/s 
 * @param velpcity_e_acc   1b Velocity in East direction accuracy, m/s 
 * @param velpcity_d_acc   1b Velocity in Down direction accuracy, m/s 
 * @param latitude   Latitude, deg 
 * @param longitude   Longitude, deg 
 * @param altitude   Altitude above Mean Sea Level, m 
 * @param undulation   Altitude difference between the geoid and the Ellipsoid. (WGS-84 Altitude = MSL Altitude + undulation), m 
 * @param latitude_acc   1b Latitude accuracy, deg 
 * @param longitude_acc   1b Longitude accuracy, deg 
 * @param altitude_acc   1b Vertical Position accuracy, m 
 * @param solution_status   Global solution status 
 * @return length of the message in bytes (excluding serial stream start sign)
 */
static inline uint16_t mavlink_msg_xap_sbg_ekf_nav_msg_pack_chan(uint8_t system_id, uint8_t component_id, uint8_t chan,
                               mavlink_message_t* msg,
                                   uint32_t time_boot_ms,int8_t sbg_id,float velpcity_n,float velpcity_e,float velpcity_d,float velpcity_n_acc,float velpcity_e_acc,float velpcity_d_acc,double latitude,double longitude,double altitude,float undulation,float latitude_acc,float longitude_acc,float altitude_acc,uint32_t solution_status)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN];
    _mav_put_double(buf, 0, latitude);
    _mav_put_double(buf, 8, longitude);
    _mav_put_double(buf, 16, altitude);
    _mav_put_uint32_t(buf, 24, time_boot_ms);
    _mav_put_float(buf, 28, velpcity_n);
    _mav_put_float(buf, 32, velpcity_e);
    _mav_put_float(buf, 36, velpcity_d);
    _mav_put_float(buf, 40, velpcity_n_acc);
    _mav_put_float(buf, 44, velpcity_e_acc);
    _mav_put_float(buf, 48, velpcity_d_acc);
    _mav_put_float(buf, 52, undulation);
    _mav_put_float(buf, 56, latitude_acc);
    _mav_put_float(buf, 60, longitude_acc);
    _mav_put_float(buf, 64, altitude_acc);
    _mav_put_uint32_t(buf, 68, solution_status);
    _mav_put_int8_t(buf, 72, sbg_id);

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), buf, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN);
#else
    mavlink_xap_sbg_ekf_nav_msg_t packet;
    packet.latitude = latitude;
    packet.longitude = longitude;
    packet.altitude = altitude;
    packet.time_boot_ms = time_boot_ms;
    packet.velpcity_n = velpcity_n;
    packet.velpcity_e = velpcity_e;
    packet.velpcity_d = velpcity_d;
    packet.velpcity_n_acc = velpcity_n_acc;
    packet.velpcity_e_acc = velpcity_e_acc;
    packet.velpcity_d_acc = velpcity_d_acc;
    packet.undulation = undulation;
    packet.latitude_acc = latitude_acc;
    packet.longitude_acc = longitude_acc;
    packet.altitude_acc = altitude_acc;
    packet.solution_status = solution_status;
    packet.sbg_id = sbg_id;

        memcpy(_MAV_PAYLOAD_NON_CONST(msg), &packet, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN);
#endif

    msg->msgid = MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG;
    return mavlink_finalize_message_chan(msg, system_id, component_id, chan, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_MIN_LEN, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_CRC);
}

/**
 * @brief Encode a xap_sbg_ekf_nav_msg struct
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param msg The MAVLink message to compress the data into
 * @param xap_sbg_ekf_nav_msg C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_xap_sbg_ekf_nav_msg_encode(uint8_t system_id, uint8_t component_id, mavlink_message_t* msg, const mavlink_xap_sbg_ekf_nav_msg_t* xap_sbg_ekf_nav_msg)
{
    return mavlink_msg_xap_sbg_ekf_nav_msg_pack(system_id, component_id, msg, xap_sbg_ekf_nav_msg->time_boot_ms, xap_sbg_ekf_nav_msg->sbg_id, xap_sbg_ekf_nav_msg->velpcity_n, xap_sbg_ekf_nav_msg->velpcity_e, xap_sbg_ekf_nav_msg->velpcity_d, xap_sbg_ekf_nav_msg->velpcity_n_acc, xap_sbg_ekf_nav_msg->velpcity_e_acc, xap_sbg_ekf_nav_msg->velpcity_d_acc, xap_sbg_ekf_nav_msg->latitude, xap_sbg_ekf_nav_msg->longitude, xap_sbg_ekf_nav_msg->altitude, xap_sbg_ekf_nav_msg->undulation, xap_sbg_ekf_nav_msg->latitude_acc, xap_sbg_ekf_nav_msg->longitude_acc, xap_sbg_ekf_nav_msg->altitude_acc, xap_sbg_ekf_nav_msg->solution_status);
}

/**
 * @brief Encode a xap_sbg_ekf_nav_msg struct on a channel
 *
 * @param system_id ID of this system
 * @param component_id ID of this component (e.g. 200 for IMU)
 * @param chan The MAVLink channel this message will be sent over
 * @param msg The MAVLink message to compress the data into
 * @param xap_sbg_ekf_nav_msg C-struct to read the message contents from
 */
static inline uint16_t mavlink_msg_xap_sbg_ekf_nav_msg_encode_chan(uint8_t system_id, uint8_t component_id, uint8_t chan, mavlink_message_t* msg, const mavlink_xap_sbg_ekf_nav_msg_t* xap_sbg_ekf_nav_msg)
{
    return mavlink_msg_xap_sbg_ekf_nav_msg_pack_chan(system_id, component_id, chan, msg, xap_sbg_ekf_nav_msg->time_boot_ms, xap_sbg_ekf_nav_msg->sbg_id, xap_sbg_ekf_nav_msg->velpcity_n, xap_sbg_ekf_nav_msg->velpcity_e, xap_sbg_ekf_nav_msg->velpcity_d, xap_sbg_ekf_nav_msg->velpcity_n_acc, xap_sbg_ekf_nav_msg->velpcity_e_acc, xap_sbg_ekf_nav_msg->velpcity_d_acc, xap_sbg_ekf_nav_msg->latitude, xap_sbg_ekf_nav_msg->longitude, xap_sbg_ekf_nav_msg->altitude, xap_sbg_ekf_nav_msg->undulation, xap_sbg_ekf_nav_msg->latitude_acc, xap_sbg_ekf_nav_msg->longitude_acc, xap_sbg_ekf_nav_msg->altitude_acc, xap_sbg_ekf_nav_msg->solution_status);
}

/**
 * @brief Send a xap_sbg_ekf_nav_msg message
 * @param chan MAVLink channel to send the message
 *
 * @param time_boot_ms [ms] Timestamp (milliseconds since system boot)
 * @param sbg_id   Sbg device id 
 * @param velpcity_n   Velocity in North direction, m/s 
 * @param velpcity_e   Velocity in East direction, m/s 
 * @param velpcity_d   Velocity in Down direction, m/s 
 * @param velpcity_n_acc   1b Velocity in North direction accuracy, m/s 
 * @param velpcity_e_acc   1b Velocity in East direction accuracy, m/s 
 * @param velpcity_d_acc   1b Velocity in Down direction accuracy, m/s 
 * @param latitude   Latitude, deg 
 * @param longitude   Longitude, deg 
 * @param altitude   Altitude above Mean Sea Level, m 
 * @param undulation   Altitude difference between the geoid and the Ellipsoid. (WGS-84 Altitude = MSL Altitude + undulation), m 
 * @param latitude_acc   1b Latitude accuracy, deg 
 * @param longitude_acc   1b Longitude accuracy, deg 
 * @param altitude_acc   1b Vertical Position accuracy, m 
 * @param solution_status   Global solution status 
 */
#ifdef MAVLINK_USE_CONVENIENCE_FUNCTIONS

static inline void mavlink_msg_xap_sbg_ekf_nav_msg_send(mavlink_channel_t chan, uint32_t time_boot_ms, int8_t sbg_id, float velpcity_n, float velpcity_e, float velpcity_d, float velpcity_n_acc, float velpcity_e_acc, float velpcity_d_acc, double latitude, double longitude, double altitude, float undulation, float latitude_acc, float longitude_acc, float altitude_acc, uint32_t solution_status)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char buf[MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN];
    _mav_put_double(buf, 0, latitude);
    _mav_put_double(buf, 8, longitude);
    _mav_put_double(buf, 16, altitude);
    _mav_put_uint32_t(buf, 24, time_boot_ms);
    _mav_put_float(buf, 28, velpcity_n);
    _mav_put_float(buf, 32, velpcity_e);
    _mav_put_float(buf, 36, velpcity_d);
    _mav_put_float(buf, 40, velpcity_n_acc);
    _mav_put_float(buf, 44, velpcity_e_acc);
    _mav_put_float(buf, 48, velpcity_d_acc);
    _mav_put_float(buf, 52, undulation);
    _mav_put_float(buf, 56, latitude_acc);
    _mav_put_float(buf, 60, longitude_acc);
    _mav_put_float(buf, 64, altitude_acc);
    _mav_put_uint32_t(buf, 68, solution_status);
    _mav_put_int8_t(buf, 72, sbg_id);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG, buf, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_MIN_LEN, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_CRC);
#else
    mavlink_xap_sbg_ekf_nav_msg_t packet;
    packet.latitude = latitude;
    packet.longitude = longitude;
    packet.altitude = altitude;
    packet.time_boot_ms = time_boot_ms;
    packet.velpcity_n = velpcity_n;
    packet.velpcity_e = velpcity_e;
    packet.velpcity_d = velpcity_d;
    packet.velpcity_n_acc = velpcity_n_acc;
    packet.velpcity_e_acc = velpcity_e_acc;
    packet.velpcity_d_acc = velpcity_d_acc;
    packet.undulation = undulation;
    packet.latitude_acc = latitude_acc;
    packet.longitude_acc = longitude_acc;
    packet.altitude_acc = altitude_acc;
    packet.solution_status = solution_status;
    packet.sbg_id = sbg_id;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG, (const char *)&packet, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_MIN_LEN, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_CRC);
#endif
}

/**
 * @brief Send a xap_sbg_ekf_nav_msg message
 * @param chan MAVLink channel to send the message
 * @param struct The MAVLink struct to serialize
 */
static inline void mavlink_msg_xap_sbg_ekf_nav_msg_send_struct(mavlink_channel_t chan, const mavlink_xap_sbg_ekf_nav_msg_t* xap_sbg_ekf_nav_msg)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    mavlink_msg_xap_sbg_ekf_nav_msg_send(chan, xap_sbg_ekf_nav_msg->time_boot_ms, xap_sbg_ekf_nav_msg->sbg_id, xap_sbg_ekf_nav_msg->velpcity_n, xap_sbg_ekf_nav_msg->velpcity_e, xap_sbg_ekf_nav_msg->velpcity_d, xap_sbg_ekf_nav_msg->velpcity_n_acc, xap_sbg_ekf_nav_msg->velpcity_e_acc, xap_sbg_ekf_nav_msg->velpcity_d_acc, xap_sbg_ekf_nav_msg->latitude, xap_sbg_ekf_nav_msg->longitude, xap_sbg_ekf_nav_msg->altitude, xap_sbg_ekf_nav_msg->undulation, xap_sbg_ekf_nav_msg->latitude_acc, xap_sbg_ekf_nav_msg->longitude_acc, xap_sbg_ekf_nav_msg->altitude_acc, xap_sbg_ekf_nav_msg->solution_status);
#else
    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG, (const char *)xap_sbg_ekf_nav_msg, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_MIN_LEN, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_CRC);
#endif
}

#if MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN <= MAVLINK_MAX_PAYLOAD_LEN
/*
  This varient of _send() can be used to save stack space by re-using
  memory from the receive buffer.  The caller provides a
  mavlink_message_t which is the size of a full mavlink message. This
  is usually the receive buffer for the channel, and allows a reply to an
  incoming message with minimum stack space usage.
 */
static inline void mavlink_msg_xap_sbg_ekf_nav_msg_send_buf(mavlink_message_t *msgbuf, mavlink_channel_t chan,  uint32_t time_boot_ms, int8_t sbg_id, float velpcity_n, float velpcity_e, float velpcity_d, float velpcity_n_acc, float velpcity_e_acc, float velpcity_d_acc, double latitude, double longitude, double altitude, float undulation, float latitude_acc, float longitude_acc, float altitude_acc, uint32_t solution_status)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    char *buf = (char *)msgbuf;
    _mav_put_double(buf, 0, latitude);
    _mav_put_double(buf, 8, longitude);
    _mav_put_double(buf, 16, altitude);
    _mav_put_uint32_t(buf, 24, time_boot_ms);
    _mav_put_float(buf, 28, velpcity_n);
    _mav_put_float(buf, 32, velpcity_e);
    _mav_put_float(buf, 36, velpcity_d);
    _mav_put_float(buf, 40, velpcity_n_acc);
    _mav_put_float(buf, 44, velpcity_e_acc);
    _mav_put_float(buf, 48, velpcity_d_acc);
    _mav_put_float(buf, 52, undulation);
    _mav_put_float(buf, 56, latitude_acc);
    _mav_put_float(buf, 60, longitude_acc);
    _mav_put_float(buf, 64, altitude_acc);
    _mav_put_uint32_t(buf, 68, solution_status);
    _mav_put_int8_t(buf, 72, sbg_id);

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG, buf, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_MIN_LEN, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_CRC);
#else
    mavlink_xap_sbg_ekf_nav_msg_t *packet = (mavlink_xap_sbg_ekf_nav_msg_t *)msgbuf;
    packet->latitude = latitude;
    packet->longitude = longitude;
    packet->altitude = altitude;
    packet->time_boot_ms = time_boot_ms;
    packet->velpcity_n = velpcity_n;
    packet->velpcity_e = velpcity_e;
    packet->velpcity_d = velpcity_d;
    packet->velpcity_n_acc = velpcity_n_acc;
    packet->velpcity_e_acc = velpcity_e_acc;
    packet->velpcity_d_acc = velpcity_d_acc;
    packet->undulation = undulation;
    packet->latitude_acc = latitude_acc;
    packet->longitude_acc = longitude_acc;
    packet->altitude_acc = altitude_acc;
    packet->solution_status = solution_status;
    packet->sbg_id = sbg_id;

    _mav_finalize_message_chan_send(chan, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG, (const char *)packet, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_MIN_LEN, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_CRC);
#endif
}
#endif

#endif

// MESSAGE XAP_SBG_EKF_NAV_MSG UNPACKING


/**
 * @brief Get field time_boot_ms from xap_sbg_ekf_nav_msg message
 *
 * @return [ms] Timestamp (milliseconds since system boot)
 */
static inline uint32_t mavlink_msg_xap_sbg_ekf_nav_msg_get_time_boot_ms(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  24);
}

/**
 * @brief Get field sbg_id from xap_sbg_ekf_nav_msg message
 *
 * @return   Sbg device id 
 */
static inline int8_t mavlink_msg_xap_sbg_ekf_nav_msg_get_sbg_id(const mavlink_message_t* msg)
{
    return _MAV_RETURN_int8_t(msg,  72);
}

/**
 * @brief Get field velpcity_n from xap_sbg_ekf_nav_msg message
 *
 * @return   Velocity in North direction, m/s 
 */
static inline float mavlink_msg_xap_sbg_ekf_nav_msg_get_velpcity_n(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  28);
}

/**
 * @brief Get field velpcity_e from xap_sbg_ekf_nav_msg message
 *
 * @return   Velocity in East direction, m/s 
 */
static inline float mavlink_msg_xap_sbg_ekf_nav_msg_get_velpcity_e(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  32);
}

/**
 * @brief Get field velpcity_d from xap_sbg_ekf_nav_msg message
 *
 * @return   Velocity in Down direction, m/s 
 */
static inline float mavlink_msg_xap_sbg_ekf_nav_msg_get_velpcity_d(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  36);
}

/**
 * @brief Get field velpcity_n_acc from xap_sbg_ekf_nav_msg message
 *
 * @return   1b Velocity in North direction accuracy, m/s 
 */
static inline float mavlink_msg_xap_sbg_ekf_nav_msg_get_velpcity_n_acc(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  40);
}

/**
 * @brief Get field velpcity_e_acc from xap_sbg_ekf_nav_msg message
 *
 * @return   1b Velocity in East direction accuracy, m/s 
 */
static inline float mavlink_msg_xap_sbg_ekf_nav_msg_get_velpcity_e_acc(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  44);
}

/**
 * @brief Get field velpcity_d_acc from xap_sbg_ekf_nav_msg message
 *
 * @return   1b Velocity in Down direction accuracy, m/s 
 */
static inline float mavlink_msg_xap_sbg_ekf_nav_msg_get_velpcity_d_acc(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  48);
}

/**
 * @brief Get field latitude from xap_sbg_ekf_nav_msg message
 *
 * @return   Latitude, deg 
 */
static inline double mavlink_msg_xap_sbg_ekf_nav_msg_get_latitude(const mavlink_message_t* msg)
{
    return _MAV_RETURN_double(msg,  0);
}

/**
 * @brief Get field longitude from xap_sbg_ekf_nav_msg message
 *
 * @return   Longitude, deg 
 */
static inline double mavlink_msg_xap_sbg_ekf_nav_msg_get_longitude(const mavlink_message_t* msg)
{
    return _MAV_RETURN_double(msg,  8);
}

/**
 * @brief Get field altitude from xap_sbg_ekf_nav_msg message
 *
 * @return   Altitude above Mean Sea Level, m 
 */
static inline double mavlink_msg_xap_sbg_ekf_nav_msg_get_altitude(const mavlink_message_t* msg)
{
    return _MAV_RETURN_double(msg,  16);
}

/**
 * @brief Get field undulation from xap_sbg_ekf_nav_msg message
 *
 * @return   Altitude difference between the geoid and the Ellipsoid. (WGS-84 Altitude = MSL Altitude + undulation), m 
 */
static inline float mavlink_msg_xap_sbg_ekf_nav_msg_get_undulation(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  52);
}

/**
 * @brief Get field latitude_acc from xap_sbg_ekf_nav_msg message
 *
 * @return   1b Latitude accuracy, deg 
 */
static inline float mavlink_msg_xap_sbg_ekf_nav_msg_get_latitude_acc(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  56);
}

/**
 * @brief Get field longitude_acc from xap_sbg_ekf_nav_msg message
 *
 * @return   1b Longitude accuracy, deg 
 */
static inline float mavlink_msg_xap_sbg_ekf_nav_msg_get_longitude_acc(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  60);
}

/**
 * @brief Get field altitude_acc from xap_sbg_ekf_nav_msg message
 *
 * @return   1b Vertical Position accuracy, m 
 */
static inline float mavlink_msg_xap_sbg_ekf_nav_msg_get_altitude_acc(const mavlink_message_t* msg)
{
    return _MAV_RETURN_float(msg,  64);
}

/**
 * @brief Get field solution_status from xap_sbg_ekf_nav_msg message
 *
 * @return   Global solution status 
 */
static inline uint32_t mavlink_msg_xap_sbg_ekf_nav_msg_get_solution_status(const mavlink_message_t* msg)
{
    return _MAV_RETURN_uint32_t(msg,  68);
}

/**
 * @brief Decode a xap_sbg_ekf_nav_msg message into a struct
 *
 * @param msg The message to decode
 * @param xap_sbg_ekf_nav_msg C-struct to decode the message contents into
 */
static inline void mavlink_msg_xap_sbg_ekf_nav_msg_decode(const mavlink_message_t* msg, mavlink_xap_sbg_ekf_nav_msg_t* xap_sbg_ekf_nav_msg)
{
#if MAVLINK_NEED_BYTE_SWAP || !MAVLINK_ALIGNED_FIELDS
    xap_sbg_ekf_nav_msg->latitude = mavlink_msg_xap_sbg_ekf_nav_msg_get_latitude(msg);
    xap_sbg_ekf_nav_msg->longitude = mavlink_msg_xap_sbg_ekf_nav_msg_get_longitude(msg);
    xap_sbg_ekf_nav_msg->altitude = mavlink_msg_xap_sbg_ekf_nav_msg_get_altitude(msg);
    xap_sbg_ekf_nav_msg->time_boot_ms = mavlink_msg_xap_sbg_ekf_nav_msg_get_time_boot_ms(msg);
    xap_sbg_ekf_nav_msg->velpcity_n = mavlink_msg_xap_sbg_ekf_nav_msg_get_velpcity_n(msg);
    xap_sbg_ekf_nav_msg->velpcity_e = mavlink_msg_xap_sbg_ekf_nav_msg_get_velpcity_e(msg);
    xap_sbg_ekf_nav_msg->velpcity_d = mavlink_msg_xap_sbg_ekf_nav_msg_get_velpcity_d(msg);
    xap_sbg_ekf_nav_msg->velpcity_n_acc = mavlink_msg_xap_sbg_ekf_nav_msg_get_velpcity_n_acc(msg);
    xap_sbg_ekf_nav_msg->velpcity_e_acc = mavlink_msg_xap_sbg_ekf_nav_msg_get_velpcity_e_acc(msg);
    xap_sbg_ekf_nav_msg->velpcity_d_acc = mavlink_msg_xap_sbg_ekf_nav_msg_get_velpcity_d_acc(msg);
    xap_sbg_ekf_nav_msg->undulation = mavlink_msg_xap_sbg_ekf_nav_msg_get_undulation(msg);
    xap_sbg_ekf_nav_msg->latitude_acc = mavlink_msg_xap_sbg_ekf_nav_msg_get_latitude_acc(msg);
    xap_sbg_ekf_nav_msg->longitude_acc = mavlink_msg_xap_sbg_ekf_nav_msg_get_longitude_acc(msg);
    xap_sbg_ekf_nav_msg->altitude_acc = mavlink_msg_xap_sbg_ekf_nav_msg_get_altitude_acc(msg);
    xap_sbg_ekf_nav_msg->solution_status = mavlink_msg_xap_sbg_ekf_nav_msg_get_solution_status(msg);
    xap_sbg_ekf_nav_msg->sbg_id = mavlink_msg_xap_sbg_ekf_nav_msg_get_sbg_id(msg);
#else
        uint8_t len = msg->len < MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN? msg->len : MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN;
        memset(xap_sbg_ekf_nav_msg, 0, MAVLINK_MSG_ID_XAP_SBG_EKF_NAV_MSG_LEN);
    memcpy(xap_sbg_ekf_nav_msg, _MAV_PAYLOAD(msg), len);
#endif
}
